import { computed, ref } from 'vue'
import { defineStore } from 'pinia'

// 使用样例仓储
export const demoCounterStore = defineStore('demo', () => {

    //region # States

    // 包含列表
    const count = ref(0)

    //endregion

    //region # Getters

    // 双倍数量
    const doubleCount = computed(() => count.value * 2)

    //endregion

    //region # Actions

    /**
     * 移除包含元素
     * @param componentName - 组件名称
     * */
    function increment() {
        count.value++
    }

    //endregion

    return { count, doubleCount, increment }
})